import request from '@/utils/request';
// 获取广告列表
export async function pageApps(data) {
  const res = await request.post('/AppList', data);
  // console.log(666666666, res);
  if (res.status === 0) {
    return res.data;
  }
  return Promise.reject(new Error(res.msg));
}
// 删除
export async function removeApp(ids) {
  const res = await request.post('/DeleteApp', ids);

  if (res.status === 0) {
    return res.msg;
  }
  return Promise.reject(new Error(res.msg));
}
// 批量删除
export async function removeApps(data) {
  const res = await request.post('/DeleteApp', data);
  if (res.status === 0) {
    return res.msg;
  }
  return Promise.reject(new Error(res.msg));
}
// 添加广告
export async function addApp(data) {
  const res = await request.post('/CreateApp', data);
  if (res.status === 0) {
    return res.msg;
  }
  return Promise.reject(new Error(res.msg));
}
// 修改广告
export const updateApp = async (data) => {
  const res = await request.post('/UpdateApp', data);
  if (res.status === 0) {
    return res.msg;
  }
  return Promise.reject(new Error(res.msg));
};
